Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of conformsTo too draconian? #101

Closed
mattgarrish opened this issue Oct 7, 2019 · 16 comments · Fixed by #116
Closed

Lack of conformsTo too draconian? #101

mattgarrish opened this issue Oct 7, 2019 · 16 comments · Fixed by #116

Comments

@mattgarrish
Copy link
Member

Right now, it's a fatal error if you don't specify @context or identify the profile in conformsTo.

Without a common base, like we had with web publications, there isn't a default profile that we can recommend user agents fall back on to try and open a publication.

So the question is, can people live with the fatal error, or should we try and find some compromise wording to allow a user agent to attempt to open an unknown manifest using a profile it does know how to process?

@iherman
Copy link
Member

iherman commented Oct 7, 2019

... or we fall back on requiring the https://www.w3.org/TR/pub-manifest, or setting this one as a default.

@mattgarrish
Copy link
Member Author

https://www.w3.org/TR/pub-manifest, or setting this one as a default

That would give it a value, but what does it mean for processing? There are no behaviours associated with a generic pub manifest.

@iherman
Copy link
Member

iherman commented Oct 7, 2019

It could mean something like no specific behaviour is defined for that manifest (apart from the processing steps defined in the spec), and the URL just says that the manifest is meant to be a valid manifest per the pub-manifest specification.

Obviously not very useful. But it makes testing, etc, more straightforward; it may also allow unforeseen or experimental readers to develop with some local knowledge without the need to change the manifest.

(To be clear: I did not think it through 100%, so there may be fatal caveats.)

@mattgarrish
Copy link
Member Author

It could mean something like no specific behaviour is defined for that manifest

In theory, yes, but what does a dedicated audiobook player presented with this manifest do, for example? Won't it have to try and open the publication as an audiobook if it doesn't barf on it?

If it was just the web we were talking about it probably wouldn't matter, you could process the manifest and just leave whatever linked to the manifest alone as a web page. But for distributed content there's going to be some expectation of what the package contains. I don't think we can ever capture what that expectation is, though.

It seems like the user agent could opt to either: 1) issue a fatal error and not render the content; or 2) issue a validation error and continue processing based on whatever it is capable of rendering.

@iherman
Copy link
Member

iherman commented Oct 7, 2019

In theory, yes, but what does a dedicated audiobook player presented with this manifest do, for example? Won't it have to try and open the publication as an audiobook if it doesn't barf on it?

To be honest, I do not really know but, clearly, if somebody creates an audiobook, than he/she should definitely set the right pointer.

Again, I would regard such a pointer (ie, to the pub-manifest) more as some sort of a testing/development conformance profile, without specifying it further. Which, I guess, means that my option would be:

  1. issue a validation error and continue processing based on whatever it is capable of rendering.

Maybe even adding the pub-manifest reference as a default setting in the processing step.

@mattgarrish
Copy link
Member Author

Maybe even adding the pub-manifest reference as a default setting in the processing step.

Ya, I was thinking about this when I got up and if we default to https://www.w3.org/TR/pub-manifest, maybe we could recommend in the audiobook specification that user agents attempt to open such publications.

Of course, every profile would have to say the same, but at some point there's no way to get consistent behaviour for an unidentified profile.

@iherman
Copy link
Member

iherman commented Oct 10, 2019

maybe we could recommend in the audiobook specification that user agents attempt to open such publications.

I am not sure what you mean. Some user agent can be prepared for a general profile, some may be extremely specialized and would understand only a specific profile(s).

@mattgarrish
Copy link
Member Author

Some user agent can be prepared for a general profile, some may be extremely specialized and would understand only a specific profile(s).

Yes, and when a specialized audiobook UA processing a publication comes across this undefined "profile" because someone left out conformsTo, what does it do with the publication? Shouldn't it still attempt to open it, or where does the failure occur? It's not about whether some deliberately puts the profile in, although the idea that there can be a "general profile" is confusing to me.

How a user agent can prepare for an undefined implementation, for example? We don't actually define any presentation logic in the manifest itself, so what governs its rendering?

If we're expecting a common interface, then we need to go beyond the manifest so that there is meaningful presentation logic associated with pub-manifest that all implementations can inherit. But that seems like the path back to web publications.

Otherwise, a profile doesn't have to make any modifications to the base profile, but it should at least distinguish itself as a profile in order to differentiate itself as it will have to add some rules governing its content and consumption.

@iherman
Copy link
Member

iherman commented Oct 14, 2019

I tried to gather my thoughts on all this. I think we cannot avoid that the characteristics of the User Agent are somehow part of the processing steps, but I do not think this is bad (and it is already the case).

Obviously, the terminology and the editorial style should be made better, and I did not look at how the bullet points should be distributed over the document.

In the Manifest

  • The value of the conformsTo property is a single conformance identifier, or an array thereof. These conformance identifiers are absolute URLs.
  • Each conformance identifier SHOULD be dereferencable to a document that describes the meaning/interpretation of this identifier.
  • Each publication profile MUST define a conformance identifier, also referred to as a publication conformance identifier. A publication profile specification SHOULD describe a minimal behavior that a User Agent should provide if it understands that profile.
    • specifications (including specifications that do not define a publication profile) MAY also define conformance identifiers that are not publication conformance identifiers, e.g., for the purposes of accessibility. This specification does not apply or define any rules on how those extra identifiers are used.
  • Each user agent SHOULD announce the publication conformance identifiers it understands, i.e., whose behavior, described in the corresponding document, it can provide as a minimal behavior.
  • This specification defines a specific publication conformance identifier, namely https://www.w3.org/TR/pub-manifest/. This is primarily used for testing purposes, but very simple user agents (e.g., simple browser extension) may also be able to refer that profile providing a basic, reading experience for the publication (e.g., "just" displaying the resources in the reading order). There is no minimal user agent behavior assigned to this publication conformance identifier.

In the processing steps

(This should replace of step §4 in the PR version)

Let profile be that the User Agent understands and the manifest conforms to. Set profile as follows:

  • If manifest["conformsTo"] is not set, this is a fatal error, return failure
  • If manifest["conformsTo"] is a single value, check whether the User Agent understands that value. If yes, set profile to that value, otherwise this is a fatal error, return failure
  • If manifest["conformsTo"] is an array, consider the values on the array, moving from the first item to the last:
    • if the User Agent understands that value, set profile to that value, then break
  • If profile is not set, this is a fatal error, return failure

Notes:

  • I deliberately avoided to overuse the term 'profile', and used the terminology on conformance identification. Otherwise we get to the terminological issue that the pub manifest document does not define a profile, "just" a vocabulary...

  • This is a draconian behavior, akin to XML processing, which is not very 'Webby'. On the other hand, we do not have any minimal User Agent behavior defined, so it is difficult to define/imagine anything else.

  • We could say that the https://www.w3.org/TR/pub-manifest/ identifier is some sort of a default; this means that the first step should say something like:

    • If manifest["conformsTo"] is not set, and the User Agent understands the publication conformance identifier with the value of https://www.w3.org/TR/pub-manifest/, then set this as the value of profile. Otherwise this is a fatal error, return failure.

    I must admit that, at this point, I am undecided whether such default value for conformsTo is a good thing or not.

@iherman
Copy link
Member

iherman commented Oct 14, 2019

This issue was discussed in a meeting.

  • No actions or resolutions
View the transcript Lack of conformsTo too draconian?
Garth Conboy: #101
Garth Conboy: There has been quite a bit of commentary on this. Matt and Ivan having a few, Ivan do you want to comment here?
Ivan Herman: I feel uncomfortable without Matt - the point is that conformsTo came into the standard not too long ago (September?) but what we realized is how it actually works is missing. The current official standard is draconian…
… it requires a list of references to specifications that the document conforms to. If it’s missing, everything stops and the user agent is supposed to return an error and finish. My original question is that ‘isn’t that harsh’ but then it’s how exactly does the usage work?
Ivan Herman: See proposal for a conformsTo mechanism
Ivan Herman: the clarification was around what we expect from conformsTo… What I did this morning was to write down what I see - I just put it on IRC - I put there a mechanism that is not yet reflected in any of the documents. It’s a reasonable behavior for a conformsTo. I haven’t gotten a reply or comment yet.
… I can summarize what I wrote there, or people can read it and comment there. Thats where we are.
Garth Conboy: You do have 1 thumbs up…
Ivan Herman: Which is more than 0…
Garth Conboy: What would you like to be the next step? … OK there is a PR version of this…
Ivan Herman: There is a PR of the preview status. We’re in a situation where there is an outstanding PR and the issue is on that one…
… so it’s not yet fully fleshed out in any text.
Dave Cramer: I am uneasy about the ‘draconian’ aspect of this. Thinking from the perspective of a web-dev who gets some audiobook who has the manifest. What i’m most interested in is going and getting the reading order. That’s the most important thing to present the user with what I want..
… so now I have to have an if statement that if the conformsTo isn’t there, the user can’t listen to the audiobook, even if everything else is there…
Ivan Herman: The discussion is around that - I was asking the same question. Formally and spec wise - what I came up with is a possibility is to have a kind of 0-level conformance reference. Which is saying the manifest conforms to what we describe in this text (publication manifest)
… and this is the minimal thing. The UA can say : “i can do something with this” but another UA might say it can do something more and needs a higher conformance.
… what I also consider is that this value - the basic conformance reference is a default value. If someone doesn’t put anything, then this is always there and the user agent can do something with that. Please go through the text and see if that makes sense.
Garth Conboy: Ivan, I’m looking at it now and I want to make sure I understand. In the top bullet, if it’s missing, it’s a fatal error, but we could possibly override with a default?
Ivan Herman: I have some notes, and the last point there would modify that step.
Garth Conboy: I’m personally with Dave that, having a non-fatal error and being able to pull out reading order seems good to me.
Benjaming Young: I am wondering if someone can make a case for the draconian approach. I agree with Dave that there is a real danger here of creating an infinite number of profiles that are incompatible by a generic reader…
… ultimately I don’t think anyone would actually conform to it - it should be a signal. If something gets stuck in there that is non-conformant, who cares - the consumer just wishes to read the book. If the reader can read it, that’s what’s important
… if there is a good reason to force this, let us know…
Garth Conboy: it sounds like that we like the default value so maybe we should lean that way on the call and ask Ivan & Draft to draft something that goes in that direction as a PR. It’s me or Matt
… There is the whole issue with Matt not being on the call, but I leave it to you to decide on that

@iherman
Copy link
Member

iherman commented Oct 14, 2019

This issue was discussed in a meeting.

  • No actions or resolutions
View the transcript update manifest processing to use infra types
Garth Conboy: See Issue #101
Garth Conboy: See Issue #98
Ivan Herman: See PR #103
Garth Conboy: There are 2 issues in this pull request - this is also one that Ivan and Matt have…
… Does anyone on the call want to run through this and hope to get to a consensus?
Ivan Herman: The work was done by Matt.
… I would prefer Romain to comment on this as he was the one initiating this whole work and can give a more appropriate background.
Romain Deltour: Basically it originated from trying to get rid of the webIGL as a way to describe a datastructure. In trying to harmonize the various manifests in the W3C, we wanted to use infra-types to represent the data structure. Matt’s editing the spec to replace webIGL for infra types.
Ivan Herman: See Infra standard
Romain Deltour: The WebIDL representative is moved to informative edits. A few different issues were raised when we looked at the algorithm. I think it’s clearer now, but we need more reviews there. It will be interesting to have more.
Garth Conboy: Looking at the PR, Romain you have one requested change outstanding and Ivan has approved it.
Ivan Herman: I am now repeating what Dave said earlier on the other PR. This was a pretty large change that made the document better and Matt did great work. Now it becomes difficult to discuss other issues and details with this as a PR.
Romain Deltour: I think my requests have been addressed in Matt’s latest changes
Ivan Herman: I would be in favor of merging this ASAP (as soon as Matt is comfortable) then we can comment and modify once it’s in. Again, this is something he should do…
Romain Deltour: +1 on merging and doing more reviews/changes based on Matt’s work
Garth Conboy: Sounds good for me. If there are subsequent changes, they will be smaller. Barring objection, why don’t we go ahead and put that as a request for Matt…

@iherman
Copy link
Member

iherman commented Oct 15, 2019

B.t.w., looking at the processing step and the WebIDL part: in fact, the WebIDL should contain a profile value (and not an array) and not a conformsTo value. The WebIDL represents the internal data structure (not the manifest JSON file), and the processing actually picks a single profile value here...

@iherman
Copy link
Member

iherman commented Oct 15, 2019

Looking at the document version October 14... To avoid misunderstanding, here is what the algorithm says:

(§ 2.7 Profile Conformance) Let profile be the profile the manifest conforms to. Set profile as follows:

a. If manifest["conformsTo"] is not set, validation error, set to « "https://www.w3.org/TR/pub-manifest" ».
b. If manifest["conformsTo"] does not include a URL of a profile the user agent is capable of processing and/or rendering, fatal error, return failure.
c. If manifest["conformsTo"] includes the URLs of more than one profile the user agent is capable of processing and/or rendering, set to the first in the array in the case of conflicting requirements.
d. Otherwise, set to the profile defined by the URL the user agent is capable of processing and/or rendering.

But... would (d) ever occur?

  • step a. ensures that the array is never empty
  • step c. ensures that the user agent finds a suitable URL if there is any
  • step b. says that if there is no suitable URL, it is a fatal error and returns failure

Steps c. and b. are complementary, i.e., step d. will never occur...

Shouldn't we say that it is not a fatal error but a warning? I.e., we could modify the steps as:

a. If manifest["conformsTo"] is not set, validation error, set to « "https://www.w3.org/TR/pub-manifest" ».
c. If manifest["conformsTo"] includes the URLs of more than one profile the user agent is capable of processing and/or rendering, set to the first in the array in the case of conflicting requirements.
d. Otherwise, validation error, and set to a profile defined by the URL the user agent is capable of processing and/or rendering.

@mattgarrish
Copy link
Member Author

Shouldn't we say that it is not a fatal error but a warning?

I'm lost. Why would it be a validation error for there to be a single usable profile URL? That's what your third step leads to.

The four possible scenarios are:

  • the profile property isn't set.
  • the profile property is set, but none of the values are usable.
  • the profile property is set and has more than one usable value.
  • the profile property is set and has exactly one usable value.

If we wanted to try and compress these, only the first two and last two can be coaxed into similar statements:

  • if the profile property isn't set, or doesn't contain any usable values, validation error, set to the default
  • if the profile property contains one or more usable value, set to the first.

(But "setting to the first" is awkward terminology when we can't be sure if there is an array of values.)

I also avoided saying that profile has to be a string because there seems to be this idea that a publication might conform to a bunch of profiles at the same time. I'm still not clear how this works in practice, though.

But can you explain how there is a profile of the generic manifest? Where is this profile defined? How does anyone find out what it means? What does a user agent do with it? I still can't wrap my head around what use this default has.

Wouldn't it be better to say that if a publication has no profile or an unrecognized profile, the user agent should still attempt to open the publication as though it were conforming to a profile it is capable of rendering? I'm okay with not having a fatal error, but I don't like this generic profile idea.

@mattgarrish
Copy link
Member Author

mattgarrish commented Oct 15, 2019

Or how about we try digging deeper into when the user agent might be able to continue processing with wording like this:

(§ 2.7 Profile Conformance) Let profile be the profile the manifest conforms to. Set profile as follows:

  1. If manifest["conformsTo"] is not set, or does not include a profile the user agent recognizes as capable of processing and/or rendering, the user agent SHOULD inspect the media type(s) of the resources in the reading order to determine if the publication matches a profile it is capable of processing or rendering. If so, validation error, set profile to the matching profile. Otherwise, fatal error, return failure.

  2. Otherwise, set profile to the first URL in manifest["conformsTo"] the user agent is capable of processing and/or rendering.

Note
The value of manifest["conformsTo"] could be a string or a list at this step in the process.

@iherman
Copy link
Member

iherman commented Oct 16, 2019

I have the impression that our intentions are the same and, actually, we are even saying the same in our versions (e.g., I tried to avoid the term 'profile' in #101 (comment) to avoid questions that you were raising about a default profile).

However... I actually like your last proposal (#101 (comment)). It is concise and straight to the point; I would propose to keep to that one, and remove all the previous attempts from our minds...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants